package com.axjy.service;

import com.axjy.dao.ProviderMapper;
import com.axjy.pojo.Provider;
import com.axjy.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * Created by Administrator on 2017/12/26.
 */
public class ProviderService {
    SqlSession session= MyBatisUtil.getSession();
    ProviderMapper providerMapper=session.getMapper(ProviderMapper.class);
    public List<Provider> searchAll(){
        List<Provider> list=providerMapper.list();
        MyBatisUtil.closeSession(session);
        return list;
    }

    public List<Provider> search(String proname){
        List<Provider> list=providerMapper.search(proname);
        MyBatisUtil.closeSession(session);
        return list;
    }



}
